package net.xiduth.game.minigames.soulwars;

/*
 *Authors:
 *Savions Sw and Newb123 
 */

import net.xiduth.game.player.Skills;
import net.xiduth.game.player.controlers.Controler;

public class SoulWarsLobbyControler extends Controler {

	/**
	 * Processes an event of a button click
	 */
	
	@Override
	public boolean processButtonClick(int interfaceId, int componentId,
			int slotId, int packetId) {
		if (interfaceId == 276) {
			if (componentId == 37) {
				if (packetId == 14)
					player.getPackets().sendGameMessage("You recieve 72.000 Attack xp for each zeal you spend.");
				if (packetId == 67) {
					if (player.zeals >= 1) {
						player.getSkills().addXp(Skills.ATTACK, 4000);
						player.getPackets().sendGameMessage("You spend 1 Zeal and recieve 72.000 Attack xp for return.");
						player.zeals-=1;
					} else
					player.getPackets().sendGameMessage("You need more Zeals to do that.");
				if (packetId == 5) {
					if (player.zeals >= 10) {
							player.getSkills().addXp(Skills.ATTACK, 44000);
							player.getPackets().sendGameMessage("You spend 1 Zeal and recieve 720.000 Attack xp + A 72.000 xp bonus for return.");
							player.zeals-=10;
						} else
							player.getPackets().sendGameMessage("You need more Zeals to do that.");
				if (packetId == 55) {
						if (player.zeals >= 100) {
								player.getSkills().addXp(Skills.ATTACK, 444000);
								player.getPackets().sendGameMessage("You spend 1 Zeal and recieve 7200.000 Attack xp + A 720.000 xp bonus for return.");
								player.zeals-=100;
							} else
								player.getPackets().sendGameMessage("You need more Zeals to do that.");
						}
					}
				}
			}
		}
		return true;
	}

	@Override
	public void start() {
		// TODO Auto-generated method stub
		
	}
}
